package com.itheima.homework1.demo1;

public class GoldCard extends  Card{
    public GoldCard(String id, double balance) {
        super(id, balance);
    }

    @Override
    public void pay(Card card,double money) {
        card.consume(money);
        System.out.println("使用金卡支付,享受8折优惠，您当前的余额为："+ getBalance());
        System.out.println("您当前消费的金额为："+ money * 0.8);
        setBalance(getBalance() - money * 0.8);
    }
}
